﻿using Autofac;
using Autofac.Integration.Mvc;

namespace Common
{
    public class IocHelper
    {
        /// <summary>
        /// Atuofac生产对象
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <returns></returns>
        public static TService AutofacResolve<TService>()
        {
            return AutofacDependencyResolver.Current.ApplicationContainer.Resolve<TService>();
        }
    }
}
